﻿using System;
using System.Configuration;

namespace DevMaker.CM.Mailing.App_code {
    public class Util {
        public static String PathFile {
            get {
                var fechahoy = DateTime.Now;
                if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["fechaHoy"]))
                    fechahoy = DateTime.ParseExact(ConfigurationManager.AppSettings["fechaHoy"], "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);

                return ConfigurationManager.AppSettings["PathFiles"] + "\\" + fechahoy.ToString("yyyyMMdd");
            }
        }
        public static DateTime FechaHoy {
            get {
                var fechahoy = DateTime.Now;
                if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["fechaHoy"])) {
                    fechahoy = DateTime.ParseExact(ConfigurationManager.AppSettings["fechaHoy"], "yyyy-MM-dd",
                                                   System.Globalization.CultureInfo.InvariantCulture);

                }
                return fechahoy;
            }
        }
    }
}
